package com.example.sys.address.service;

import com.example.core.mapping.Mapping;
import com.example.core.service.BaseTreeServiceImpl;
import com.example.sys.address.dao.SysAddressDao;
import com.example.sys.address.mapping.SysAddressMapping;
import com.example.sys.address.po.SysAddress;
import com.example.sys.address.vo.SysAddressVo;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

@Service
public class SysAddressServiceImpl extends BaseTreeServiceImpl<SysAddressDao, SysAddress, SysAddressVo> implements SysAddressService {

    @Override
    public Class<? extends Mapping> getMappingClass() {
        return SysAddressMapping.class;
    }

    @Cacheable(cacheNames = TREECACHE, key = "#root.targetClass.getName()")
    @Override
    public List<SysAddress> findTreeList(HttpServletRequest request, HttpServletResponse response) {
        return super.findTreeList(request, response);
    }
}
